Most portable electronic devices generally just have one universal serial bus (USB) interface. The USB interface can achieve data transmission, OTG (On-The-Go) function, battery charging, and other functions. One USB interface can achieve multiple functions, but when the USB interface is used for transmitting data or implementing OTG function, the battery power of the electronic device cannot be charged or discharged from the USB interface.